<!--
 * @Author: your name
 * @Date: 2020-12-28 09:55:39
 * @LastEditTime: 2020-12-28 10:06:02
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \basiccss\box\margin.html
-->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>外边距</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        main{
            border: 2px solid green;
            width: 500px;
            height: 500px;
            margin: 0 auto;
        }
        h2{
            border: solid 2px green;
            width: 300px;
            height: 300px;
            /* margin: 50px 80px 100px 150px; */
            /* margin: 50px 80px; */
            margin: 100px;/*将边距全部定义为100*/
        }
    </style>
</head>
<body>
    <main>
        <h2>houdunren.com</h2>
    </main>
</body>
</html>